package com.gxa.jjty.admin.service.impl;

import com.gxa.jjty.admin.mapper.HandicappedMapper;
import com.gxa.jjty.admin.service.HandicappedService;
import com.gxa.jjty.core.pojo.Handicapped;
import com.gxa.jjty.core.service.impl.BaseServiceImpl;
import com.gxa.jjty.core.util.StringUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;


import java.util.Date;
import java.util.List;
import java.util.Map;

@Service("handicappedService")
public class HandicappedServiceImpl extends BaseServiceImpl<Handicapped> implements HandicappedService {
    @Autowired
    HandicappedMapper handicappedMapper;

    @Override
    public List<Handicapped> selectByFiedl(String from, String to, String code, String name, String phone, String state) {
       if(!StringUtil.isEmpty(code)){
           code="%"+code+"%";
       }
        if(!StringUtil.isEmpty(name)){
            name="%"+name+"%";
        }
        if(!StringUtil.isEmpty(phone)){
            phone="%"+phone+"%";
        }
        List<Handicapped> handicappeds = handicappedMapper.selectByFiedl(from, to, code, name, phone, state);

        return handicappeds;
    }
}
